package com.xhs.hawaii.common.utils.excel;

import lombok.Data;

@Data
public class ColumnInfo {
    private static final int DEFAULT_WIDTH = 10;
    public ColumnInfo(String fieldName, String headerName, ColumnType columnType) {
        this(fieldName, headerName, columnType, DEFAULT_WIDTH);
    }

    public ColumnInfo(String fieldName, String headerName, ColumnType columnType, int width) {
        this.fieldName = fieldName;
        this.headerName = headerName;
        this.columnType = columnType;
        this.width = width;
    }

    // 字段名（与Data中的字段名一致，取数据用）
    private String fieldName;
    // 表头名称
    private String headerName;
    // 列类型
    private ColumnType columnType;
    // 列宽
    private int width;

    public enum ColumnType{
        STRING,
        NUMERIC,  // 数字，整数
        DECIMAL2, // 数字，2位小数
        DECIMAL4, // 数字，4位小数
        LINK_URL; //超链接，url
    }

}
